#include "mythread.h"

myThread::myThread(QTcpSocket *s)
{
    client = s;
}

void myThread::run()
{
    connect(client, &QTcpSocket::readyRead, this, &myThread::clientinfo);
}


void myThread::clientinfo()
{
    QByteArray ba = client->readAll();
    emit threadinfosendtoWidget(ba,client);
    if(1 == QString(ba).toInt())
    {
        qDebug() << "受到命令1";
    }
    ba += " 收到";
    client->write(ba);
    qDebug() << "收到,响应";

}
